package com.easybuy.Tools;

import net.spy.memcached.MemcachedClient;

import java.net.InetSocketAddress;

public class MemcachedJava {
    private static MemcachedClient mcc;
    static {
        try{
            // 本地连接 Memcached 服务
            mcc = new MemcachedClient(new InetSocketAddress("127.0.0.1", 11211));
            System.out.println("Connection to server sucessful.");

            // 关闭连接
            //mcc.shutdown();

        }catch(Exception ex){
            System.out.println( ex.getMessage() );
        }
    }

    public static MemcachedClient getMcc() {
        return mcc;
    }
}
